#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Checker.h>
#include <IsGtThan.h>
#include <IsLsThan.h>
#include <IsNotGtThan.h>
#include <IsNotLsThan.h>

USING_MOCKCPP_NS USING_TESTNGPP_NS

FIXTURE(Checker)
{
    TEST(valid data in "(0,100]" should be true)
    {
        IsGtThan isGtThan(0);
        IsNotGtThan isNotGtThan(100);
        Checker checker(&isGtThan, &isNotGtThan);

        double tstData[] = {0.001,50,100};

        for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
        {
            ASSERT_TRUE(checker(tstData[i]));
        }
    }

    TEST(data is out of "(0,100]" should be false)
     {
         IsGtThan isGtThan(0);
         IsNotGtThan isNotGtThan(100);
         Checker checker(&isGtThan, &isNotGtThan);

         double tstData[] = {0.00,100.000001};

         for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
         {
             ASSERT_FALSE(checker(tstData[i]));
         }
     }

    TEST(valid data in "(0,75)" should be true)
    {
        IsGtThan isGtThan(0);
        IsLsThan isLsThan(75);
        Checker checker(&isGtThan, &isLsThan);

        double tstData[] = {0.001,50,74.999};

        for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
        {
            ASSERT_TRUE(checker(tstData[i]));
        }
    }

    TEST(data is out of "(0,75)" should be false)
     {
        IsGtThan isGtThan(0);
        IsLsThan isLsThan(75);
        Checker checker(&isGtThan, &isLsThan);

         double tstData[] = {-1,0.00,75,76};

         for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
         {
             ASSERT_FALSE(checker(tstData[i]));
         }
     }
};

